import request from '@/utils/request'

// 查询门店列表
export function listStore(query) {
  return request({
    url: '/admin/store/store/list',
    method: 'get',
    params: query
  })
}

// 查询门店详细
export function getStore(id) {

  return request({
    url: '/admin/store/store/' + id,
    method: 'get'
  })
}
// 查询门店字典
export function storeListParam(){
  return request({
    url: '/admin/store/store/storeListParam',
    method: 'get'
  })
}

// 修改门店
export function updateStore(data) {
  return request({
    url: '/admin/store/store',
    method: 'put',
    data: data
  })
}
// 修改门店
export function updateAgentCode(data) {
  return request({
    url: '/admin/store/store/updateAgentCode',
    method: 'put',
    data: data
  })
}
// 删除门店
export function logicDelStore(id) {
  return request({
    url: '/admin/store/store/' + id,
    method: 'delete'
  })
}

// 导出门店
export function exportStore(query) {
  return request({
    url: '/admin/store/store/export',
    method: 'get',
    params: query
  })
}

//提现列表/admin/adapayDrawcash/list
export function cashList(query) {
  return request({
    url: '/admin/adapayDrawcash/list',
    method: 'get',
    params: query
  })
}

//同意打款/admin/adapayDrawcash/applySuccess
export function applycash(id) {
  return request({
    url: '/admin/adapayDrawcash/applySuccess?id='+id,
    method: 'post'
  })
}

//上门预约列表/admin/doorserver/list
export function reservationList(query) {
  return request({
    url: `/admin/doorserver/list`,
    method: 'get',
    params: query
  })
}

//获取上门服务分类/storeclassify/storeclassify/list
export function getClassify() {
  return request({
    url: '/storeclassify/storeclassify/doorlist',
    method: 'post',
    data: {}
  })
}

//上门服务添加/admin/doorserver
export function doorserver(data) {
  return request({
    url: '/admin/doorserver',
    method: 'post',
    data: data
  })
}

//上门服务删除/admin/doorserver/delete/2
export function doorserverDel(id) {
  return request({
    url: `/admin/doorserver/delete/${id}`,
    method: 'post'
  })
}

//上门服务修改/admin/doorserver
export function doorserverPut(data) {
  return request({
    url: `/admin/doorserver`,
    method: 'put',
    data: data
  })
}

//预约时间详情
export function appointmentTime() {
  return request({
    url: `/admin/appointment/appointmentSetInfo`,
    method: 'post'
  })
}

//预约时间设置/admin/appointment/appointmentEdit
export function appointmentEdit(data) {
  return request({
    url: `/admin/appointment/appointmentEdit`,
    method: 'post',
    data: data
  })
}

//上门预约订单列表
export function appointmentOrder(data) {
  return request({
    url: `/admin/doorserver/doorserverOrderList`,
    method: 'get',
    params: data
  })
}

//上门预约订单详情/admin/doorserver/doorserverOrderDetail
export function appointmentDetail(data) {
  return request({
    url: `/admin/doorserver/doorserverOrderDetail?id=${data.id}`,
    method: 'post'
  })
}

//获取门店,上门预约使用
export function getStoreList() {
  return request({
    url: '/admin/store/store/storeListParam',
    method: 'get'
  })
}

//获取员工列表，上门预约
export function getStuffList(storeId) {
  return request({
    url: `/admin/doorserver/getStaffList?storeId=${storeId}`,
    method: 'post'
  })
}

//指派员工
export function assignStuff(params) {
  return request({
    url: `/admin/doorserver/addDoorStoreUser?orderId=${params.orderId}&storeUserId=${params.storeUserId}`,
    method: 'post'
  })
}
